package cn.edu.scau.cmi.zengGuanSheng.client;

import javafx.fxml.FXML;

import javafx.scene.control.Button;

import javafx.scene.control.TextField;
import cn.edu.scau.cmi.zengGuanSheng.comprehensiveExperiment.MainClient;
import cn.edu.scau.cmi.zengGuanSheng.singleton.Marshal1;
import javafx.event.ActionEvent;

import javafx.scene.control.TextArea;

public class Marshal1Controller {
	@FXML
	private TextArea textArea;
	@FXML
	private TextField tf_name;
	@FXML
	private Button btn_create;
	@FXML
	private Button btn_return;

	// Event Listener on Button[#btn_create].onAction
	@FXML
	public void eventCreate(ActionEvent event) {
		// TODO Autogenerated
		String name = tf_name.getText();
		textArea.appendText(Marshal1.getInstances(name)+"\r\n");
	}
	// Event Listener on Button[#btn_return].onAction
	@FXML
	public void eventReturn(ActionEvent event) {
		// TODO Autogenerated
		Marshal1.clear();
		MainClient main = new MainClient();
		main.start(Marshal1Client.primaryStage);
	}
}
